Put breakpoints on the line number margin and let a file type restrict them - #357
Merged
hendrikmennen merged 1 commit intoSep 10, 2026
Merged
Conversation
danielpourbakhsh
force-pushed
the
feature/breakpoint-line-pattern
branch
from
September 4, 2026 20:49
21280bc to
8aa3e64
Compare
danielpourbakhsh
force-pushed
the
feature/breakpoint-line-pattern
branch
from
September 4, 2026 20:52
8aa3e64 to
eb55a47
Compare
…t them Three changes that belong together, all around the editor margin. Breakpoints move onto the line numbers: a line that carries one shows the dot in place of its number, as Rider and VS Code do. MeasureOverride stays inherited, so the column is exactly as wide as it was without breakpoints. BreakPointMargin stays and is marked obsolete. Nothing in the tree points at it any more, but it is public API, so it goes out with the next batch rather than on its own. It loses a leak on the way: the store outlives the margin, so the subscription moves into OnTextViewChanged and is released when the margin detaches. ExtendedTextEditor handed every margin a new BreakpointStore(), so a breakpoint lived in an object per editor that no debug session ever saw. The margin gets BreakpointStore.Instance instead, which also lets a breakpoint survive closing and reopening its file. ITypeAssistance gains BreakPointLinePattern, a regular expression whose null means no restriction, so a language without a rule notices nothing. Not every line of every language can carry a breakpoint: in assembly one on a data word does not fail but slips, because the line table has no entry for it and the backend moves it to the next line that has code. The rule travels as data and not as a predicate - a callback would put the core into plugin code on every click and every pointer move over the margin. Removing a breakpoint always stays possible, and the preview dot appears only where a click would take effect. SetEnableBreakpoints therefore takes the ITypeAssistance instead of a bool: the margin needs the flag and the pattern as a unit. BreakPoint carries whether the target armed it, and the margin draws a grey hollow ring when it did not, inside the same diameter so the column keeps its width. The store raises VerificationChanged for that, because the change alters no collection and a margin listening only to CollectionChanged would never repaint. The store also carries whether the target is running; while it is, the margin takes no breakpoint in either direction and says why. Both stay inert until a debug session sets them.
danielpourbakhsh
force-pushed
the
feature/breakpoint-line-pattern
branch
from
September 8, 2026 17:47
6ff1575 to
fea546e
Compare
danielpourbakhsh
marked this pull request as ready for review
September 8, 2026 18:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes around the editor margin, all of them needed before a debug session can do anything with a breakpoint: where it is drawn, who owns it, and which lines may carry one.
MeasureOverridestays inherited, so the column is exactly as wide as it was before.BreakPointMarginstays, marked[Obsolete].ExtendedTextEditorhanded every margin anew BreakpointStore(), so a breakpoint lived in an object no debug session ever saw. The margin getsBreakpointStore.Instancenow, and a breakpoint survives closing and reopening its file.ITypeAssistance.BreakPointLinePatternis a regular expression,nullmeaning no restriction — a language without a rule notices nothing of this. Our Assembly Dialect needs it:because otherwise a breakpoint on a data word, a comment or an annotation slips.
SetEnableBreakpointstakes theITypeAssistanceinstead of a single bool, because the margin needs the flag and the pattern.BreakPointrecords it and the margin draws a grey hollow ring when it did not. The store raisesVerificationChangedfor that, since the change does not alter the collection, a margin listening only toCollectionChangedwould never repaint. The store also says whether the target is running — while it is, the margin takes no breakpoint.